using System;
using System.ComponentModel;
using System.Transactions;

using SIS.ENT ;
using SIS.DAL;


/// <summary>
/// The TeacherSalaryTableManager class is responsible for managing BO.TeacherSalaryTable objects in the system.
/// </summary>
[DataObjectAttribute()]
public class TeacherSalaryTableManager
  {

#region "Public Methods"

/// <summary>
/// Gets a list with all TeacherSalaryTable objects in the database.
/// </summary>
/// <returns>A list with all TeacherSalaryTable from the database when the database contains any, or null otherwise.</returns>
[DataObjectMethod(DataObjectMethodType.Select, true)]
public static TeacherSalaryTableList GetList(){
return TeacherSalaryTableDB.GetList();
}

[DataObjectMethod(DataObjectMethodType.Select, true)]
public static TeacherSalaryTableList GetList(int userAccount)
{
    return TeacherSalaryTableDB.GetList(userAccount);
}
/// <summary>
/// Gets a single TeacherSalaryTable from the database without its data.
/// </summary>
/// <param name="teacherSalaryKey">The TeacherSalaryKey of the TeacherSalaryTable in the database.</param>
/// <returns>A TeacherSalaryTable object when the TeacherSalaryKey exists in the database, or <see langword="null"/> otherwise.</returns>
[DataObjectMethod(DataObjectMethodType.Select, false)]
public static TeacherSalaryTable GetItem(int teacherSalaryKey){
return GetItem(teacherSalaryKey, false);
}

/// <summary>
/// Gets a single TeacherSalaryTable from the database.
/// </summary>
/// <param name="teacherSalaryKey">The TeacherSalaryKey of the TeacherSalaryTable in the database.</param>
/// <param name="getTeacherSalaryTableRecords">Determines whether to load all associated TeacherSalaryTable records as well.</param>
/// <returns>
/// A TeacherSalaryTable object when the TeacherSalaryKey exists in the database, or <see langword="null"/> otherwise.
/// </returns>
[DataObjectMethod(DataObjectMethodType.Select, false)]
public static TeacherSalaryTable GetItem(int teacherSalaryKey, bool getTeacherSalaryTableRecords){
TeacherSalaryTable myTeacherSalaryTable = TeacherSalaryTableDB.GetItem(teacherSalaryKey);
return myTeacherSalaryTable;
}

/// <summary>
/// Saves a TeacherSalaryTable in the database.
/// </summary>
/// <param name="myTeacherSalaryTable">The TeacherSalaryTable instance to save.</param>
/// <returns>The new TeacherSalaryKey if the TeacherSalaryTable is new in the database or the existing TeacherSalaryKey when an item was updated.</returns>
[DataObjectMethod(DataObjectMethodType.Update, true)]
public static int Save(TeacherSalaryTable myTeacherSalaryTable){
using (TransactionScope myTransactionScope = new TransactionScope()){
int teacherSalaryTableTeacherSalaryKey = TeacherSalaryTableDB.Save(myTeacherSalaryTable);

//  Assign the TeacherSalaryTable its new (or existing TeacherSalaryKey).
myTeacherSalaryTable.TeacherSalaryKey = teacherSalaryTableTeacherSalaryKey;

myTransactionScope.Complete();

return teacherSalaryTableTeacherSalaryKey;
}
}

/// <summary>
/// Deletes a TeacherSalaryTable from the database.
/// </summary>
/// <param name="myTeacherSalaryTable">The TeacherSalaryTable instance to delete.</param>
/// <returns>Returns true when the object was deleted successfully, or false otherwise.</returns>
[DataObjectMethod(DataObjectMethodType.Delete, true)]
public static bool Delete(TeacherSalaryTable myTeacherSalaryTable){
return TeacherSalaryTableDB.Delete(myTeacherSalaryTable.TeacherSalaryKey);
}

[DataObjectMethod(DataObjectMethodType.Delete, true)]
public static bool Delete(int TeacherSalaryKey)
{
    return TeacherSalaryTableDB.Delete(TeacherSalaryKey);
}

#endregion

}

